<template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      columnsRef="accountOccupyInfoTable"
      :datakey="'rows'"
      :isSelectColumn="false"
      :onColumnsChange="columns => (this.columns = columns)"
    />
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import { getAccountOccupyInfo } from '@/api/part/accountQuery/accountCheck';
export default {
  name: 'accountOccupyInfo',
  mixins: [dictionary],
  data() {
    return {
      columns: this.createTableColumns(),
      fetchApi: getAccountOccupyInfo,
      fetchParams: { xhrAbort: false }
    };
  },
  methods: {
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '账户类型',
          dataIndex: 'creditNo'
        },
        {
          title: '金额',
          dataIndex: 'amount',
          precision: 2
        },
        {
          title: '入账票据号',
          dataIndex: 'accountEntryNumber'
        },
        {
          title: '审核日期',
          width: 150,
          dataIndex: 'auditDate',
          filterType: 'date-range',
          dateFormat: 'yyyy-MM-dd HH:mm:ss'
        },
        {
          title: '操作员',
          dataIndex: 'operatorName'
        },
        {
          title: '操作日期',
          width: 150,
          dataIndex: 'operateDate',
          filterType: 'date-range',
          dateFormat: 'yyyy-MM-dd HH:mm:ss'
        },
        {
          title: '父级经销商',
          dataIndex: 'ownerParCode'
        },
        {
          title: '经销商',
          dataIndex: 'ownerCode'
        },
        {
          title: '公司代码',
          dataIndex: 'companyCode'
        },
        {
          title: '是否移动端',
          dataIndex: 'isApp',
          render: props => {
            return <span>{this.createDictText(props.row.isApp, '1004')}</span>;
          }
        }
      ];
    }
  }
};
</script>
